fix(test): isolate soak harness daemon runtime - #2196
Conversation
scripts/soak-test.sh claimed to isolate daemon coordination from interactive sessions through a private CBM_CACHE_DIR, but only CBM_RUNTIME_DIR moves the daemon rendezvous, so the soak shared the operator's account daemon and asserted that its own shutdown stopped it. Source scripts/test-runtime.sh for a harness-owned runtime and cache, and let the helper stop the private daemon before the root is removed. Add tests/test_soak_runtime_isolation_contract.sh, which fails before this change, and wire it into scripts/test.sh. Part of DeusData#1696. Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
There was a problem hiding this comment.
🟡 Changes recommended
Address the native-Windows cleanup and setup-failure root-leak issues.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR isolates the soak-test daemon runtime and cache from interactive sessions and adds regression coverage.
Changes:
- Uses private runtime and cache directories.
- Adds a runtime-isolation contract test.
- Wires the contract into
scripts/test.sh.
File summaries
| File | Summary |
|---|---|
tests/test_soak_runtime_isolation_contract.sh |
Verifies caller runtime and cache paths are not exposed. |
scripts/test.sh |
Runs the new isolation contract. |
scripts/soak-test.sh |
Initializes and cleans up the private runtime; two moderate cleanup issues remain on native Windows. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # shellcheck source=test-runtime.sh | ||
| source "$(dirname "${BASH_SOURCE[0]}")/test-runtime.sh" | ||
| cbm_test_runtime_init | ||
| trap 'cbm_test_runtime_cleanup "$BINARY"' EXIT |
| # native-Windows cache sits under SOAK_WIN_ROOT, which goes only after the | ||
| # daemon check because the binary it probes with is the copy inside it. | ||
| cbm_test_runtime_cleanup "$BINARY" | ||
| [ -z "${SOAK_WIN_ROOT:-}" ] || rm -rf -- "$SOAK_WIN_ROOT" |
|
Merged — thank you. This is the fix for a problem that has been quietly taxing other people's pull requests for weeks, and you went after the actual cause rather than the symptom. The diagnosis in your comment is exactly right, and it matches what we had already verified from the other end: Two things I want to call out specifically: Your contract test can fail. I checked rather than trusting the green — reverting Driving the harness with an environment-probe fixture and asserting on what the product process actually receives is the right design. It tests the contract, not the implementation, so it will keep working when the harness changes again. The cleanup is careful. Routing through One note for your planning: the rest of this series (#2197, #2198, #2199) lands on |
What does this PR do?
Part of #1696 (audit ledger), follow-up to #1691/#1695.
scripts/soak-test.shclaimed to "isolate daemon coordination from interactive CBMsessions" through a private
CBM_CACHE_DIR, but onlyCBM_RUNTIME_DIRmoves thedaemon rendezvous. The soak must be the only client of the daemon it measures (it
asserts that a session crash and the final shutdown each stop the daemon), so on a
shared rendezvous it either stopped the operator's daemon or was refused with a
cache-root conflict.
scripts/soak-test.shsourcesscripts/test-runtime.shand callscbm_test_runtime_init; off native Windows the helper's owner-only cache is thesoak cache, so the daemon log path is unchanged in shape.
soak_cleanupnow runscbm_test_runtime_cleanup "$BINARY"instead ofrm -rfon the cache: the privatedaemon is stopped first and the root is kept when it will not stop. The
native-Windows stamped root and its
icaclshandling are untouched(
tests/test_soak_daemon_recovery_contract.shpins them). Two FAIL messages nolonger say "shared daemon".
tests/test_soak_runtime_isolation_contract.sh: environment-probe fixture,same assertions as the smoke contract,
RESULTS_DIRkept out of the checkout.Fails on
mainwithFAIL: soak-test exposed the caller CBM_RUNTIME_DIR to a product process; passes with this change. Wired as Step 0d2 inscripts/test.sh.scripts/soak-legs.shstarts no product process and needs no change.Checklist
git commit -s)make -f Makefile.cbm test) — shell-only change; the newcontract plus
test_soak_daemon_recovery_contract,test_venue_parity_contractand
test_runtime_isolation_contractwere run; the full C suite was not runon this host
make -f Makefile.cbm lint-ci) — no C changes